package com.zf.bm.common.core.sys.dao;

import com.zf.bm.common.core.base.dao.BaseDao;
import com.zf.bm.common.core.sys.entity.Menu;
import com.zf.bm.vo.DashBoardVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * 菜单DAO接口
 */
public interface MenuDao extends BaseDao<Menu> {

    List<Menu> findByParentIdsLike(Menu menu);

    List<Menu> findByUserId(Menu menu);

    int updateParentIds(Menu menu);

    int updateSort(Menu menu);

    int delete(Menu menu);

    List<Map<String,Integer>> queryByRoleId(@Param("id")Long id);

    @Select("select id,name,sort,is_show isShow,href from sys_menu where component='/broad/menu' and del_flag='0' order by sort asc")
    List<DashBoardVo> listForDashBord();

    int updateSortOrIsShow(@Param("item") Menu item);
}
